Skip to content

feat(spring-webmvc): add Spring Boot 4 / Spring Framework 7 api version support#11587

Closed
wconti27 wants to merge 1 commit into
masterfrom
conti/feat/spring-webmvc-sb4-api-version
Closed

feat(spring-webmvc): add Spring Boot 4 / Spring Framework 7 api version support#11587
wconti27 wants to merge 1 commit into
masterfrom
conti/feat/spring-webmvc-sb4-api-version

Conversation

@wconti27
Copy link
Copy Markdown
Contributor

@wconti27 wconti27 commented Jun 6, 2026

Summary

  • Bump latestDepTestImplementation spring-boot-starter-* to 4.+ in spring-webmvc-6.0/build.gradle to enable testing against Spring Boot 4 / Spring Framework 7
  • Read HandlerMapping.apiVersion attribute from the request and set http.api_version span tag in SpringWebHttpServerDecorator
  • Add SpringWebHttpServerDecoratorApiVersionTest validating that the api version tag is set when the attribute is present
  • Add SpringWebHttpServerDecoratorTest covering existing decorator behaviour

Motivation

Spring Framework 7 (Spring Boot 4) introduces structured API versioning via HandlerMapping. This change surfaces the resolved API version as a span tag so it is queryable in Datadog APM.

Test plan

  • ./gradlew :dd-java-agent:instrumentation:spring:spring-webmvc:spring-webmvc-6.0:compileJava :dd-java-agent:instrumentation:spring:spring-webmvc:spring-webmvc-6.0:compileTestJava — passes
  • ./gradlew :dd-java-agent:instrumentation:spring:spring-webmvc:spring-webmvc-6.0:test — unit tests pass
  • ./gradlew :dd-java-agent:instrumentation:spring:spring-webmvc:spring-webmvc-6.0:latestDepTest — passes with Spring Boot 4.x

🤖 Generated with APM Instrumentation Toolkit

…tDep support

Reads `HandlerMapping.API_VERSION_ATTRIBUTE` (added in Spring Framework 7)
from the request and records it as the `http.api_version` span tag.

Bumps latestDepTestImplementation spring-boot-starter-* pins from 3.+ to
4.+, so CI exercises the implementation against Spring Boot 4 / SF7.

Adds SpringWebHttpServerDecoratorApiVersionTest covering present / absent /
empty / non-String attribute cases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@wconti27 wconti27 force-pushed the conti/feat/spring-webmvc-sb4-api-version branch from 15e8714 to f5083b5 Compare June 6, 2026 14:33
@datadog-prod-us1-6
Copy link
Copy Markdown

Pipelines

Fix all issues with BitsAI

⚠️ Warnings

🚦 1 Pipeline job failed

Validate PR Label Format | Check pull request labels   View in Datadog   GitHub Actions

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: f5083b5 | Docs | Datadog PR Page | Give us feedback!

@wconti27 wconti27 closed this Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant